﻿using System;
namespace Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg {
    
    
    [global::Xtee.Core.Attributes.XmlTypeAttribute(Name="detailandmed_v4_kaardivaline_isik", Namespace="http://producers.arireg.xtee.riik.ee/producer/arireg", Target=typeof(DetailandmedV4KaardivalineIsik))]
    public class DetailandmedV4KaardivalineIsikSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
        
        protected IDetailandmedV4KaardivalineIsik clazz;
        
        public DetailandmedV4KaardivalineIsikSerializer(IDetailandmedV4KaardivalineIsik clazz) {
            this.clazz = clazz;
        }
        
        public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
            base.WriteXml(Writer);
            if (clazz.IsikuTyyp!=null) {
                Writer.WriteStartElement("isiku_tyyp");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuTyyp))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.IsikuRoll!=null) {
                Writer.WriteStartElement("isiku_roll");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuRoll))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.IsikuRollTekstina!=null) {
                Writer.WriteStartElement("isiku_roll_tekstina");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuRollTekstina))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.Eesnimi!=null) {
                Writer.WriteStartElement("eesnimi");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Eesnimi))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.NimiArinimi!=null) {
                Writer.WriteStartElement("nimi_arinimi");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.NimiArinimi))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.IsikukoodRegistrikood!=null) {
                Writer.WriteStartElement("isikukood_registrikood");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikukoodRegistrikood))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.ValisKood!=null) {
                Writer.WriteStartElement("valis_kood");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ValisKood))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.ValisKoodRiik!=null) {
                Writer.WriteStartElement("valis_kood_riik");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ValisKoodRiik))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.ValisKoodRiikTekstina!=null) {
                Writer.WriteStartElement("valis_kood_riik_tekstina");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ValisKoodRiikTekstina))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.Synniaeg!=null) {
                Writer.WriteStartElement("synniaeg");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "date");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdDate(((System.DateTime)(clazz.Synniaeg))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.AadressRiik!=null) {
                Writer.WriteStartElement("aadress_riik");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.AadressRiik))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.AadressRiikTekstina!=null) {
                Writer.WriteStartElement("aadress_riik_tekstina");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.AadressRiikTekstina))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.AadressEhak!=null) {
                Writer.WriteStartElement("aadress_ehak");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.AadressEhak))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.AadressEhakTekstina!=null) {
                Writer.WriteStartElement("aadress_ehak_tekstina");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.AadressEhakTekstina))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.AadressTanavMajaKorter!=null) {
                Writer.WriteStartElement("aadress_tanav_maja_korter");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.AadressTanavMajaKorter))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.OsaluseProtsent!=null) {
                Writer.WriteStartElement("osaluse_protsent");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "decimal");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdDecimal(((decimal)(clazz.OsaluseProtsent))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.OsaluseSuurus!=null) {
                Writer.WriteStartElement("osaluse_suurus");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "decimal");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdDecimal(((decimal)(clazz.OsaluseSuurus))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.OsaluseValuuta!=null) {
                Writer.WriteStartElement("osaluse_valuuta");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.OsaluseValuuta))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.OsaluseValuutaTekstina!=null) {
                Writer.WriteStartElement("osaluse_valuuta_tekstina");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.OsaluseValuutaTekstina))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.OsaluseOmandiliik!=null) {
                Writer.WriteStartElement("osaluse_omandiliik");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.OsaluseOmandiliik))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.OsaluseOmandiliikTekstina!=null) {
                Writer.WriteStartElement("osaluse_omandiliik_tekstina");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.OsaluseOmandiliikTekstina))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.OsaluseMurdosaLugeja!=null) {
                Writer.WriteStartElement("osaluse_murdosa_lugeja");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "int");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdInt(((int)(clazz.OsaluseMurdosaLugeja))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.OsaluseMurdosaNimetaja!=null) {
                Writer.WriteStartElement("osaluse_murdosa_nimetaja");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "int");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdInt(((int)(clazz.OsaluseMurdosaNimetaja))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.VolitusteLoppemiseKpv!=null) {
                Writer.WriteStartElement("volituste_loppemise_kpv");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "date");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdDate(((System.DateTime)(clazz.VolitusteLoppemiseKpv))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.KontrolliAllikas!=null) {
                Writer.WriteStartElement("kontrolli_allikas");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KontrolliAllikas))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.KontrolliAllikasTekstina!=null) {
                Writer.WriteStartElement("kontrolli_allikas_tekstina");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KontrolliAllikasTekstina))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.KontrolliAllikaKpv!=null) {
                Writer.WriteStartElement("kontrolli_allika_kpv");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "date");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdDate(((System.DateTime)(clazz.KontrolliAllikaKpv))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.AlgusKpv!=null) {
                Writer.WriteStartElement("algus_kpv");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "date");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdDate(((System.DateTime)(clazz.AlgusKpv))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.LoppKpv!=null) {
                Writer.WriteStartElement("lopp_kpv");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "date");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdDate(((System.DateTime)(clazz.LoppKpv))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.Grupp!=null) {
                Writer.WriteStartElement("grupp");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Grupp))).ToString());
                Writer.WriteEndElement();
            }
        }
        
        public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
            base.ReadXml(Reader);
            if (Reader.LocalName=="isiku_tyyp") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>isiku_tyyp");
                }
                clazz.IsikuTyyp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("isiku_tyyp")).Value;
            }
            if (Reader.LocalName=="isiku_roll") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>isiku_roll");
                }
                clazz.IsikuRoll = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("isiku_roll")).Value;
            }
            if (Reader.LocalName=="isiku_roll_tekstina") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>isiku_roll_tekstina");
                }
                clazz.IsikuRollTekstina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("isiku_roll_tekstina")).Value;
            }
            if (Reader.LocalName=="eesnimi") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>eesnimi");
                }
                clazz.Eesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("eesnimi")).Value;
            }
            if (Reader.LocalName=="nimi_arinimi") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>nimi_arinimi");
                }
                clazz.NimiArinimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("nimi_arinimi")).Value;
            }
            if (Reader.LocalName=="isikukood_registrikood") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>isikukood_registrikood");
                }
                clazz.IsikukoodRegistrikood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("isikukood_registrikood")).Value;
            }
            if (Reader.LocalName=="valis_kood") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>valis_kood");
                }
                clazz.ValisKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("valis_kood")).Value;
            }
            if (Reader.LocalName=="valis_kood_riik") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>valis_kood_riik");
                }
                clazz.ValisKoodRiik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("valis_kood_riik")).Value;
            }
            if (Reader.LocalName=="valis_kood_riik_tekstina") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>valis_kood_riik_tekstina");
                }
                clazz.ValisKoodRiikTekstina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("valis_kood_riik_tekstina")).Value;
            }
            if (Reader.LocalName=="synniaeg") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>synniaeg");
                }
                clazz.Synniaeg = new global::Xtee.Core.Schema.XsdDate(Reader.ReadElementString("synniaeg")).Value;
            }
            if (Reader.LocalName=="aadress_riik") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>aadress_riik");
                }
                clazz.AadressRiik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("aadress_riik")).Value;
            }
            if (Reader.LocalName=="aadress_riik_tekstina") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>aadress_riik_tekstina");
                }
                clazz.AadressRiikTekstina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("aadress_riik_tekstina")).Value;
            }
            if (Reader.LocalName=="aadress_ehak") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>aadress_ehak");
                }
                clazz.AadressEhak = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("aadress_ehak")).Value;
            }
            if (Reader.LocalName=="aadress_ehak_tekstina") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>aadress_ehak_tekstina");
                }
                clazz.AadressEhakTekstina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("aadress_ehak_tekstina")).Value;
            }
            if (Reader.LocalName=="aadress_tanav_maja_korter") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>aadress_tanav_maja_korter");
                }
                clazz.AadressTanavMajaKorter = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("aadress_tanav_maja_korter")).Value;
            }
            if (Reader.LocalName=="osaluse_protsent") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>osaluse_protsent");
                }
                clazz.OsaluseProtsent = new global::Xtee.Core.Schema.XsdDecimal(Reader.ReadElementString("osaluse_protsent")).Value;
            }
            if (Reader.LocalName=="osaluse_suurus") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>osaluse_suurus");
                }
                clazz.OsaluseSuurus = new global::Xtee.Core.Schema.XsdDecimal(Reader.ReadElementString("osaluse_suurus")).Value;
            }
            if (Reader.LocalName=="osaluse_valuuta") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>osaluse_valuuta");
                }
                clazz.OsaluseValuuta = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("osaluse_valuuta")).Value;
            }
            if (Reader.LocalName=="osaluse_valuuta_tekstina") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>osaluse_valuuta_tekstina");
                }
                clazz.OsaluseValuutaTekstina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("osaluse_valuuta_tekstina")).Value;
            }
            if (Reader.LocalName=="osaluse_omandiliik") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>osaluse_omandiliik");
                }
                clazz.OsaluseOmandiliik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("osaluse_omandiliik")).Value;
            }
            if (Reader.LocalName=="osaluse_omandiliik_tekstina") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>osaluse_omandiliik_tekstina");
                }
                clazz.OsaluseOmandiliikTekstina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("osaluse_omandiliik_tekstina")).Value;
            }
            if (Reader.LocalName=="osaluse_murdosa_lugeja") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>osaluse_murdosa_lugeja");
                }
                clazz.OsaluseMurdosaLugeja = new global::Xtee.Core.Schema.XsdInt(Reader.ReadElementString("osaluse_murdosa_lugeja")).Value;
            }
            if (Reader.LocalName=="osaluse_murdosa_nimetaja") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>osaluse_murdosa_nimetaja");
                }
                clazz.OsaluseMurdosaNimetaja = new global::Xtee.Core.Schema.XsdInt(Reader.ReadElementString("osaluse_murdosa_nimetaja")).Value;
            }
            if (Reader.LocalName=="volituste_loppemise_kpv") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>volituste_loppemise_kpv");
                }
                clazz.VolitusteLoppemiseKpv = new global::Xtee.Core.Schema.XsdDate(Reader.ReadElementString("volituste_loppemise_kpv")).Value;
            }
            if (Reader.LocalName=="kontrolli_allikas") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>kontrolli_allikas");
                }
                clazz.KontrolliAllikas = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kontrolli_allikas")).Value;
            }
            if (Reader.LocalName=="kontrolli_allikas_tekstina") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>kontrolli_allikas_tekstina");
                }
                clazz.KontrolliAllikasTekstina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kontrolli_allikas_tekstina")).Value;
            }
            if (Reader.LocalName=="kontrolli_allika_kpv") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>kontrolli_allika_kpv");
                }
                clazz.KontrolliAllikaKpv = new global::Xtee.Core.Schema.XsdDate(Reader.ReadElementString("kontrolli_allika_kpv")).Value;
            }
            if (Reader.LocalName=="algus_kpv") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>algus_kpv");
                }
                clazz.AlgusKpv = new global::Xtee.Core.Schema.XsdDate(Reader.ReadElementString("algus_kpv")).Value;
            }
            if (Reader.LocalName=="lopp_kpv") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>lopp_kpv");
                }
                clazz.LoppKpv = new global::Xtee.Core.Schema.XsdDate(Reader.ReadElementString("lopp_kpv")).Value;
            }
            if (Reader.LocalName=="grupp") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_v4_kaardivaline_isik>grupp");
                }
                clazz.Grupp = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("grupp")).Value;
            }
        }
    }
}
